<?php
//connect to mysql database
require("config.php");
session_start();

$customer = $_SESSION["customer"];
$sql = mysql_query("SELECT id FROM customers WHERE u_name='$customer'");
$usercount = mysql_num_rows($sql);
if($usercount == 1) {
	 while($row = mysql_fetch_array($sql)){ 
			 $pid = $row["id"];
	}
}

// delete from database
$sql = mysql_query("DELETE FROM customers WHERE id='$pid'");
header("location: logout.php"); 
exit();
?>